<%@ page import="org.apache.log4j.Logger" %>
<%@ page contentType="text/html;charset=UTF-8" language="java" isErrorPage="true" %>
<html>
    <head>
        <title>Error page</title>
    </head>
    <body>
        Произошла ошибка...
        <%
            Logger log = Logger.getLogger(page.getClass());
            log.error("Error page shown...", exception);
        %>
    </body>
</html>